package com.freemalll.merchant.domain.dto.merchantParameters;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 *参数详情
 * @author jianglr
 * @since 2025-03-05
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MerParamsDetailDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @Schema(description = "主键",hidden = true)
    private String id;

    /**
     * 参数模板id
     */
    @Schema(description = "参数模板id",hidden = true)
    private String merParamsId;

    /**
     * 父节点id
     */
    @Schema(description = "父节点id")
    private String parentId;


    /**
     * 层级
     */
    @Schema(description = "层级")
    private Integer levelNo;

    /**
     * 对应的key
     */
    @Schema(description = "对应的key")
    @NotBlank(message = "参数编码不能为空")
    private String paramKey;

    /**
     * 参数名称
     */
    @Schema(description = "参数名称")
    @NotBlank(message = "参数名称不能为空")
    private String paramName;

    /**
     * 排序码
     */
    @Schema(description = "排序码")
    private Integer orderNo;

    /**
     * 子节点
     */
    @Schema(description = "子节点")
    @Valid
    private List<MerParamsDetailDTO> children = new ArrayList<>();

}
